import React from 'react'
import styles from './index.less'
import { Row, Col} from 'antd'
import {format} from '../../utils'
import driverLogo from '../../../assets/driverLogo.png'
class detail extends React.Component {
    render() {
    const {detail} =this.props

    const orderStatusType =(e)=>{
        let text = ''
        switch(e){
            case 0:
                text = '代接单'
                break;
            case 1:
                text = '代发货'
                break;
            case 2:
                text = '发货中'
                break;
            case 5:
                text = '已发货'
                break;
            case 8:
                text = '已评价'
                break; 
            case 10:
                text = '已作废'
                break;            
        }
        return text
    }
    const truckType =(e)=>{
        let text = ''
        switch(e){
            case 0:
                text = '小型车'
                break;
            case 5:
                text = '中型车'
                break;
            case 9:
                text = '大型车'
                break;          
        }
        return text
    }
    const Colstyle ={
        padding:'10px 0 10px 0',
        boxSizing: 'border-box',
    }
    const ColFont = {
        color:'#04021D',
        fontWeight: 'bold',
        paddingRight:5
    }
    return (
      <div>
        <div className={styles.filterTop}>
            <div className={styles.title}><span style={{marginRight:20}}>{detail.releasersName}</span> 
            </div>
            <div className={styles.Searchright}>
            </div>
        </div>
        <div className={styles.listbox}>
            <Row>
                <Col sm={24} lg={12} xl={10} style={{marginBottom:30}}>
                    <Col span={24} style={Colstyle}><span style={ColFont}>订单号: </span>{detail.orderSerial }</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>发布人:</span> {detail.releasersName }</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>发布人手机号码: </span>{detail.releasersMobile }</Col>     
                    <Col span={24} style={Colstyle}><span style={ColFont}>出发地址:</span> {detail.startPlace }</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>货物数量: </span>{detail.goodsCount }</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>总公里数: </span>{detail.distance }km</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>预估价: </span>{detail.price /100}元</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>发布时间: </span>{ new Date(detail.releaseDateTime).toLocaleString()  }</Col>
                </Col>
                <Col sm={24} lg={12} xl={10} style={{marginBottom:30}}>
                    <Col span={24} style={Colstyle}><span style={ColFont}>订单状态: </span>{orderStatusType(detail.orderStatus)}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>收货人: </span>{detail.consigneeName}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>收货人联系方式: </span>{detail.consigneeMobile}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>收货地址: </span>{detail.endPlace}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>送货人: </span>{detail.driverCustomerId}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>司机名称: </span>{detail.driversName}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>司机手机号码: </span>{detail.driversMobile}</Col>
                    <Col span={24} style={Colstyle}><span style={ColFont}>司机好评率: </span>{detail.favorableRate}%</Col>
                </Col>
            </Row>
            <Row >
                <Col xs={24} sm={24}>
                    <Col  xs={24} sm={24} lg={8} style={Colstyle}><span style={ColFont}>车型: </span>{truckType(detail.truckType)  }</Col>
                    <Col  xs={24} sm={24} lg={8} style={Colstyle}><span style={ColFont}>体积(方): </span>{ detail.volume }</Col>
                    <Col  xs={24} sm={24} lg={8} style={Colstyle}><span style={ColFont}>重量(kg): </span>{ detail.weight }</Col>
                </Col>
                <Col xs={24} sm={24}>
                    <Col xs={4} sm={12} lg={8} style={Colstyle}><span style={ColFont}>接单时间: </span>{new Date(detail.ordersDateTime).toLocaleString() }</Col>
                    <Col   xs={4} sm={12} lg={8} style={Colstyle}><span style={ColFont}>收货时间: </span>{new Date(detail.receiptDateTime).toLocaleString() }</Col>
                </Col>
                <Col xs={24} sm={24}>
                    <Col span={8}  xs={24} style={Colstyle}><span style={ColFont}>备注: </span>{detail.description }</Col>
                </Col>
            </Row>
        </div>
      </div>
    );
  }
}
export default detail
